package com.kupurui.asteacher.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.text.Html;
import android.webkit.WebView;
import android.widget.TextView;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.kupurui.asteacher.R;
import com.kupurui.asteacher.bean.JobSelInfo;
import com.kupurui.asteacher.utils.URLImageParser;

import java.util.List;

/**
 * Created by Administrator on 2017/8/22.
 */

public class JobSelRadioAdapter extends CommonAdapter<JobSelInfo.AnswerBean> {

    public JobSelRadioAdapter(Context context, List<JobSelInfo.AnswerBean> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
    }

    @Override
    public void convert(ViewHolder holder, JobSelInfo.AnswerBean item, int positon) {
        TextView tvRadio = holder.getView(R.id.tv_radio);
        TextView tvOption = holder.getView(R.id.tv_option);
        tvRadio.setText(Html.fromHtml(item.getAnswer(), new URLImageParser(mContext,tvRadio), null));
        if (positon == 0){
            tvOption.setText("A");
        }else if (positon == 1){
            tvOption.setText("B");
        }else if (positon == 2){
            tvOption.setText("C");
        }else if (positon == 3){
            tvOption.setText("D");
        }

}
}
